//package com.example.workrecord.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.example.workrecord.common.Page;
//import com.example.workrecord.config.WebLog;
//import com.example.workrecord.entity.CorpUserDetail;
//import com.example.workrecord.entity.Guest;
//import com.example.workrecord.exption.BizException;
//import com.example.workrecord.service.GuestService;
//import com.example.workrecord.util.Result;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * @ClassName GuestController
// * @Description GuestController
// * @Author Bu
// * @Date 2019/06/17 10:11
// * @Version 1.0
// */
//@RestController
//@Api(value = "guestmob", description = "议程手机端接口", consumes = "application/json;charset=UTF-8")
//@RequestMapping(value = "/guestmob")
//public class GuestMobController extends BaseController {
//
//    @Autowired
//    private GuestService guestService;
//    @PostMapping("/list")
//    @ResponseBody
//    @WebLog(description = "分页查询Guest")
//    @ApiOperation(value = "分页查询Guest，根据条件查询", notes = "{\"userId\": \"用户id\",\"limit\": \"分页大小，此参数代表分页大小，最大100\",\"offset\": \"分页偏移，默认值：0\",\"startDate\": \"开始时间\",\"endDate\": \"结束时间\",\"searchDate\": \"搜索\"}")
//    public Result findUserByData(HttpServletRequest request, @RequestBody Guest vo ){
//        Page<Guest> page =new Page<>();
//        try{
//            CorpUserDetail user = getUserInfo(request);
//            if(null ==user ){
//                return Result.error("用户不可为空，请检查！");
//            }
//            checkNull(vo,"参数不可为空！");
//            page.setPageCurrent(vo.getOffset()+1);
//            page.setPageSize(vo.getLimit());
//            guestService.findGuestByData(vo,page);
//        }catch (BizException e){
//            return Result.error(e.getMessage());
//        }
//        return Result.success(page);
//    }
//
//    @PostMapping("/findById")
//    @ResponseBody
//    @WebLog(description = "根据Id查询Guest")
//    @ApiOperation(value = "根据Id查询Guest", notes = "{\"id\":\"id\"}")
//    public Result findById(HttpServletRequest request, @RequestBody JSONObject res ){
//        Guest guest=new Guest();
//        try{
//            CorpUserDetail user = getUserInfo(request);
//            if(null ==user ){
//                return Result.error("用户不可为空，请检查！");
//            }
//            checkNull(res,"参数不可为空");
//            Integer id=res.getInteger("id");
//            guest.setId(Long.valueOf(id));
//            guest=guestService.findGuestById(guest);
//        }catch (BizException e){
//            return Result.error(e.getMessage());
//        }
//        return Result.success(guest);
//    }
//}
